Dynamic memory allocation is the allocation of memory (e.g., random access memory (RAM)) for use in a user program during the run-time of that program. Memory is typically allocated from a large pool of an unused memory area, known in the art as the heap. A user, such as a software programmer, a software developer, and a system administrator, can execute a program and may notice that the program is running at a speed slower than expected and/or that the program is using significantly more dynamically allocated memory than expected. The user may wish to debug how the heap is being used by the program and to help identify how the performance of a program can be optimized.
In cases where a debugging tool has grabbed an allocated block of memory from an inferior process, a traditional solution can use knowledge of statically-allocated data within the inferior process to categorize what an allocated block of memory is being used for in the inferior process. A conventional solution relies on the fact that the debugger grabs an allocated block of memory that has some type of structure. The conventional solution looks at some known point of the grabbed allocated block of memory from an inferior process, perhaps the top of the allocated block of memory, to check whether it is a pointer to a statically-allocated bit of memory, such as a C++ vtable or some kind of type information for a run-time. However, when the debugger grabs an allocated block of memory that does not have any type of structure, the conventional solution is not capable of categorizing the block. For example, the debugger may grab an allocated block of memory from an inferior process that is bitmap data or string data that has a relatively random collection of 1s and 0s with no real structure. In such a case, the conventional solution does not have any structure within allocated block of memory which it can use to categorize the block.